<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改样本管理')" />
    <th:block th:include="include :: summernote-css" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-data-edit" th:object="${rData}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">机构：</label>
                <div class="col-sm-8">
                    <select  class="form-control" name="orgId" required>
                        <option value="">--请选择机构--</option>
                        <option th:each="item:${@dict.getType('fx_org')}" th:value="${item.getDictValue()}" th:field="*{orgId}">[[${item.getDictLabel()}]]</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input name="orgId" th:field="*{name}" class="form-control" type="text">
                </div>
            </div>
<!--            <div class="form-group">-->
<!--                <label class="font-noraml">上传文件</label>-->
<!--                <input id="fileUploadPic" type="file"  name="file" >-->
<!--            </div>-->
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">上传路径：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="url" th:field="*{url}" id="picUrl" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: importFileUpLoad" />
    <script th:inline="javascript">
        var prefix = ctx + "system/data";
        var code = 'data' + Math.floor(Math.random()*(100001)+10000)
        $("#form-data-edit").validate({
            focusCleanup: true
        });


        function submitHandler() {
            if ($.validate.form()) {
                // $('#loading').css('display','block');
                // $('#step_show').html('zip开始解压缩…');
                var data = $('#form-data-edit').serializeArray();
                console.log(data)
                data.push({ "name": "code", "value": code});
                console.log(data)
                $.operate.save(prefix + "/edit", data);
                // var interval = setInterval(function(){
                //     $.ajax({
                //         type: "GET",
                //         url: "../progress/getProgress?code="+code,
                //         contentType: "application/json",
                //         success: function (r) {
                //             let queueModel = r.queueModel;
                //             let curStatus = queueModel.curStatus;
                //
                //             if(curStatus == 'analysis_unzip_start') {
                //                 $('#step_show').html('模型zip文件解压缩中…');
                //             }
                //             if(curStatus == 'analysis_conda_unzip_start') {
                //                 $('#step_show').html('运行环境zip文件解压缩中…');
                //             }
                //             if(curStatus == 'analysis_start_sh_start') {
                //                 $('#step_show').html('开始生成启动脚本…');
                //             }
                //             if(curStatus == 'analysis_shutdown_sh_start') {
                //                 $('#step_show').html('开始生成停止脚本…');
                //             }
                //
                //             if(curStatus == 'all_end') {
                //                 $('#loading').css('display','none');
                //                 clearInterval(interval);
                //             }
                //         }
                //     });
                //
                //
                // }, 200);

            }
        }
    </script>
</body>
</html>